<?php 
function robots($text)
{
	$ch = curl_init();

	$url = "http://openapi.tuling123.com/openapi/api/v2";

	$data = array(
		'perception'=>array(
			'inputText'=>array(
				'text'=>$text
				),
			),
		'userInfo'=>array(
			'apiKey'=>'facc47b9f3afc7a493121bf6aacab53f',
			'userId'=>'18925139194',
			)
		);

	$data = json_encode($data);

	// echo $data;


	curl_setopt($ch, CURLOPT_URL, $url);

	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

	curl_setopt($ch, CURLOPT_POST, 1);

	curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

	curl_setopt($ch, CURLOPT_HTTPHEADER, array(
	    'Content-Type: application/json',
	    'Content-Length: ' . strlen($data))
	);

	$output = curl_exec($ch);


	return json_decode($output,true)['results'][0];

	curl_close($ch);

}











 ?>